b61f06761db36560596136536b9cd78cdd0bde14,hazelcast/src/test/java/com/hazelcast/map/impl/record/RecordsTest.java,RecordsTest,getValueOrCachedValue_whenRecordIsCachedDataRecord_thenCache,#,74
Before Change
public void getValueOrCachedValue_whenRecordIsCachedDataRecord_thenCache() {
String objectPayload = "foo";
Data dataPayload = serializationService.toData(objectPayload);
Record record = mock(CachedDataRecord.class);
when(record.getValue()).thenReturn(dataPayload);
Records.getValueOrCachedValue(record, serializationService);
verify(record, times(1)).setCachedValue(objectPayload);
}
After Change
public void getValueOrCachedValue_whenRecordIsCachedDataRecord_thenCache() {
String objectPayload = "foo";
Data dataPayload = serializationService.toData(objectPayload);
Record record = new CachedDataRecord(dataPayload);
Object firstDeserilizedValue = Records.getValueOrCachedValue(record, serializationService);
assertEquals(objectPayload, firstDeserilizedValue);
//we don't need serialization service for the 2nd call